Class Threshold

Instances of the Threshold-class represent the current values for a tool result threshold and are used to verify whether the result is within its limits to determine whether the tool execution is successful.

Threshold instances for the thresholds of a tool (as specified with Tool.register) are retrieved from the thresholds interface in execute.

Threshold:contains(value)
Argument:
  • value (number)

Return type:

boolean

Returns True if the given value is within the threshold.

Threshold usage example

function MyTool:execute(input, output)
  local someValue = computeValue(input)

  local valueOK = self.thresholds.SomeValue:contains(someValue)
  output:add("Pass", valueOK)
end

See also